<!DOCTYPE html>
<html lang="zh-CN" style="background:#fff;">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>{ms:global.name/}</title>
    <link rel="stylesheet" href="{ms:globalskin.url/}/css/login-reg.css">
    <link rel="stylesheet" href="{ms:globalskin.url/}/css/list.css">
    <link rel="stylesheet" href="{ms:globalskin.url/}/css/index.css" >
    <link rel="stylesheet" href="{ms:globalskin.url/}/css/gui.css" >
    <script type="text/javascript" src="{ms:globalskin.url/}/js/jquery-1.9.1.min.js"></script>
    <script src="http://static.ming-soft.net/base/ms.base.min.js"></script> 
    <script src="http://static.ming-soft.net/util/ms.util.min.js"></script>
    <script src="http://static.ming-soft.net/people/ms.people.min.js" type="text/javascript"></script>  
</head>
<body>
{ms:include filename=head.htm/} 
    <div class="wrap grow gmt30 gpack" style=" min-height: 417px;margin-bottom: 50px;">
      <div class="gspan-6 gprefix-3 gsuffix-3 side" style="width:350px">
        <div class="side-title">你还可以用第三方帐号登录</div>
        <div class="extoauth2"> 
           <a rel="nofollow" class="icon weibo" href="javascript:void(0);">微博帐号登录</a>
           <a rel="nofollow" class="icon qq" href="javascript:void(0);">qq帐号登录</a>
           <a rel="nofollow" class="icon douban" href="javascript:void(0);">豆瓣帐号登录</a>
        </div>
        <p>已有账号？
        	<a rel="nofollow" id="changeVcode" href="{ms:global.host/}/login.do">马上登录</a> 
        </p>
      </div>
      <div class="gspan-15 gprefix-4 main">
        <h1>欢迎加入铭飞</h1>
        <form class="gform" id="regForm"  method="POST" >
          <p class="gform-box">
            <input class="gbtxt" id="user_name" maxlength="12" name="peopleName" placeholder="用户名" required type="text" value="">
          </p>
          <p class="gform-box">
            <input class="gbtxt" id="user_pass" maxlength="20" name="peoplePassword" placeholder="请输入密码" required type="password" value="">
          </p>
          <p class="gform-box">
            <input class="gbtxt" id="user_pass2" maxlength="20" name="confirmUserPassword" placeholder="确认密码" required type="password" value="">
          </p>
          <p class="gform-box" style="margin-bottom:0px;">
            <input type="hidden" name="isImgCode" value="true"/>
            <input class="gbtxt" id="user_code" maxlength="4" style="width: 259px;" name="rand_code" placeholder="验证码" required type="text" value="">
			      <img id="yzmimg" class="ms-w32 ms-h16" style="position: relative;top: 9px;height:26px;width:86px;" src="/code" onclick="this.src='/code?t='+new Date().getTime()">
          </p> 
          <div class="infor-tips"></div>
          <p class="gform-box">
            <button type="button" class="gform-submit greg-btn"  id="greg-btn"  name="login">注　册
            </button>
          </p>
        </form>
      </div>
    </div>
    {ms:include filename=foot.htm/} 
</body>
</html>
<script>
//后去用户名输入框
var user_name = $("#user_name");
//获取密码输入框
var user_pass = $("#user_pass");
//获取确认密码输入框
var user_pass2 = $("#user_pass2");
//验证码输入框
var user_code = $("#user_code");
//注册验证开始
$("#greg-btn").click(function () {
    $("span").remove();
    //判断用户名是否为空
    if(user_name.val().length < 3 ) {
      user_name.after("<span class='tip'>用户名长度太短</span>");
      return false;
    }else if(user_name.val().length > 12){
      user_name.after("<span class='tip'>用户名长度太长</span>");
      return false;
    }
    //判断密码长达
    else if(user_pass.val().length < 6 || user_pass.val().length > 20){
      user_pass.after("<span class='tip'>密码长度不正确</span>");
      return false;
	  //两次密码是否一致
    }else if(user_pass.val() != user_pass2.val()){
      user_pass2.after("<span class='tip'>两次密码不一致</span>");
      return false;
    }else{     
      //调用方法           
      ms.people.web.register(1,{"people":$("#regForm").serialize(),"func":function(json){
         if(json.result == false){
            if(json.resultMsg=="验证码错误!"){
                $(".infor-tips").html("<span style='margin-left:3px' class='tip'>"+json.resultMsg+"</span>");  
            }else{
                user_name.after("<span class='tip'>"+json.resultMsg+"</span>");
            }
         }else{
             alert("注册成功！请登录");
             location.href = "{ms:global.host/}/login.do"
         }
      }});
    }
})
</script>
